package  
{
	import flash.display.Stage;
	import flash.events.Event;
	import Objetos.Nave
	import Levels.Level1
	import flash.display.MovieClip;
	import Objetos.Tiro;
	/**
	 * ...
	 * @author Gabriel Ribeiro
	 */
	public class Main extends MovieClip
	{
		public var MC_tela					:MovieClip;
		public var MC_pay1					:MovieClip;
		public var MC_play2					:MovieClip;
		
		private var LV_fase1				:Level1;
		private var MC_tiro					:Tiro;
		private var levelState				:String;
		
		public static var começou			:Boolean;
		
		private static var _instance		:Main = null;
		
		public static function getInstance():Main
		{
			return _instance;
		}
		
		public static function getStage():Stage
		{
			return getInstance().stage;
		}
		
		public function Main() 
		{
			_instance = this;
			
			//telaInicial();
			
			iniciarJogo();
		}
		
		/*public function telaInicial();
		{
			MC_play1 = new player1();
			MC_pay1.x = 300
			MC_pay1.y = 100
			addChild(MC_pay1)
		}*/
		
		public function iniciarJogo():void
		{
			MC_tela = new MovieClip();
			addChild(MC_tela);
			
			levelState = "Level1";
			LV_fase1 = new Level1();
			addEventListener(Event.ENTER_FRAME, update, false, 0, true)
			desenharTela();
		}
		
		public function desenharTela():void
		{
			switch (levelState)
			{
				case "Level1":
				LV_fase1.desenharTela();
				break;
			}
		}
		
		public function update (e:Event):void
		{
			switch (levelState)
			{
				case "Level1":
				LV_fase1.update();
			 	break;
			}
		}
	}

}